package com.morn.fanfou.model;

import android.provider.BaseColumns;

public class MessageModel extends BaseModel {

	private static MessageModel instance = null;

	private MessageModel(String paramString) {
		this.tableName = paramString;
	}

	public static MessageModel getInstance() {
		if (instance == null)
			instance = new MessageModel("messages");
		return instance;
	}

	@Override
	public Class<?> getColumnClass() {
		return Message.class;
	}

	@Override
	public String getCreateSql() {
		return "CREATE TABLE IF NOT EXISTS " + this.tableName + " (" + Message._ID
				+ " INTEGER PRIMARY KEY AUTOINCREMENT," + Message.MESSAGE_ID
				+ " LONG UNIQUE ON CONFLICT REPLACE,user_id" + " INTEGER,user_name" + " TEXT,head_url" + " TEXT,time"
				+ " LONG,content" + " TEXT,title" + " TEXT, is_read" + " INTEGER,is_out_message" + " INTEGER);";
	}

	public static class Message implements BaseColumns {

		public static final String MESSAGE_ID = "id";

		public static final String TEXT = "text";

		public static final String SENDER_ID = "sender_id";

		public static final String RECIPIENT_ID = "recipient_id";

		public static final String CREATED_AT = "created_at";

		public static final String SENDER_SCREEN_NAME = "sender_screen_name";
	}

}
